#pragma once
#include <vector>
#include "stdafx.h"

#define BORDER 20
#define TRACK_WIDTH 40
#define TRACK_LENGTH 40

class Track
{
public:
	Track(void);
	~Track(void);

	bool getNextTrack(std::vector<Vector2>* t, bool vertical=false);
	
	void unsetTrackTaken(int index);

	void initialize();
	bool initialized();
	bool getNextMissedNode(Vector2* v, Vector2 position = Vector2());

	void markReady();
	bool isReady();

	void markDone();
	bool isDone();

	std::vector<Vector2> getCleanupPoints();

private:
	bool getNextHorizontalTrack(std::vector<Vector2>* t);
	bool getNextVerticalTrack(std::vector<Vector2>* t);

	std::vector<bool> taken;
	std::vector<bool> verticalTaken;
	std::vector< std::vector< Vector2 > > tracks;
	std::vector< std::vector< Vector2 > > verticalTracks;

	std::vector<bool> taken2;
	std::vector<bool> verticalTaken2;

	bool initialCleanup;
	std::vector< Vector2 > missed;
	std::vector< bool > explored;

	int ready;
	int tanks_done;
};

